home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / ham / sattrk31.tgz / sattrack-3.1.tar / SatTrack / src / include / hpterm.h next >
C/C++ Source or Header  |  1995-03-15  |  10KB  |  180 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*  Title       : hpterm.h                                                    */
  4. /*  Author      : Charlie Panek                                               */
  5. /*  Date        : 09Dec93                                                     */
  6. /*  Last change : 14Mar95                                                     */
  7. /*                                                                            */
  8. /*  Synopsis    : This include file contains the hpterm display macros for    */
  9. /*                the satellite tracking program 'sattrack'.                  */
  10. /*                                                                            */
  11. /*  Adapted from vt100.h by Manfred Bester                                    */
  12. /*                                                                            */
  13. /******************************************************************************/
  14.  
  15. /******************************************************************************/
  16. /*                                                                            */
  17. /* doBeep: generates a beep as warning                                        */
  18. /*                                                                            */
  19. /******************************************************************************/
  20.  
  21. #ifdef NOBEEP
  22. #define doBeep()
  23. #else
  24. #define doBeep() putchar('\007')
  25. #endif
  26.  
  27. /******************************************************************************/
  28. /*                                                                            */
  29. /* gotoXY: cursor positioning, go to column "x" and row "y"                   */
  30. /*         escape sequence: ESC&amcnR     n, m = row, column                  */
  31. /*                                                                            */
  32. /******************************************************************************/
  33.  
  34. #define gotoXY(x,y) printf("\033&a%dc%dR",x-1,y-1)
  35.  
  36. /******************************************************************************/
  37. /*                                                                            */
  38. /* upCurs: moves cursor up by n lines                                         */
  39. /*         command: ESC&a-0c-nR                                               */
  40. /*                                                                            */
  41. /******************************************************************************/
  42.  
  43. #define upCurs(n) printf("\033&a-0c-%dR",n)
  44.  
  45. /******************************************************************************/
  46. /*                                                                            */
  47. /* downCurs: moves cursor down by n lines                                     */
  48. /*           command: ESC&a-0c+nR                                             */
  49. /*                                                                            */
  50. /******************************************************************************/
  51.  
  52. #define downCurs(n) printf("\033&a-0c+%dR",n)
  53.  
  54. /******************************************************************************/
  55. /*                                                                            */
  56. /* advCurs: advances cursor by n blanks in the same line                      */
  57. /*          command: ESC&a+nc+0R                                              */
  58. /*                                                                            */
  59. /******************************************************************************/
  60.  
  61. #define advCurs(n) printf("\033&a+%dc+0R",n)
  62.  
  63. /******************************************************************************/
  64. /*                                                                            */
  65. /* backCurs: moves cursor backward by n blanks in the same line               */
  66. /*           command: ESC&a-nc+0R                                             */
  67. /*                                                                            */
  68. /******************************************************************************/
  69.  
  70. #define backCurs(n) printf("\033&a-%dc+0R",n)
  71.  
  72. /******************************************************************************/
  73. /*                                                                            */
  74. /* clearCurs: clear the line from cursor position                             */
  75. /*            command for clearing the rest of a line: ESCK                   */
  76. /*                                                                            */
  77. /******************************************************************************/
  78.  
  79. #define clearCurs() printf("\033K")
  80.  
  81. /******************************************************************************/
  82. /*                                                                            */
  83. /* clearLine: clear the line from cursor position (see also gotoXY())         */
  84. /*            this function is gotoXY() and clearcurs() in one                */
  85. /*                                                                            */
  86. /******************************************************************************/
  87.  
  88. #define clearLine(x,y) printf("\033&a%dc%dR\033K",x-1,y-1)
  89.  
  90. /******************************************************************************/
  91. /*                                                                            */
  92. /* clearScreen: clears entire screen from cursor position                     */
  93. /*                                                                            */
  94. /******************************************************************************/
  95.  
  96. #define clearScreen() printf("\033J")
  97.  
  98. /******************************************************************************/
  99. /*                                                                            */
  100. /* underline: switches terminal (hpterm) into underline mode                  */
  101. /*            turn on underline option: ESC&dD                                */
  102. /*                                                                            */
  103. /******************************************************************************/
  104.  
  105. #ifdef REVERSEVIDEO
  106. #define underline() printf("\033&dD")
  107. #else
  108. #define underline()
  109. #endif
  110.  
  111. /******************************************************************************/
  112. /*                                                                            */
  113. /* reverse: switches terminal (hpterm) into reverse mode                      */
  114. /*          turn on reverse option: ESC&dB                                    */
  115. /*                                                                            */
  116. /******************************************************************************/
  117.  
  118. #ifdef REVERSEVIDEO
  119. #define reverse() printf("\033&dB")
  120. #else
  121. #define reverse()
  122. #endif
  123.  
  124. /******************************************************************************/
  125. /*                                                                            */
  126. /* reverseBlink: switches terminal (hpterm) into reverse blink mode           */
  127. /*               turn on reverse and blink option: ESC&dC                     */
  128. /*                                                                            */
  129. /******************************************************************************/
  130.  
  131. #ifdef REVERSEVIDEO
  132. #define reverseBlink() printf("\033&dC")
  133. #else
  134. #define reverseBlink()
  135. #endif
  136.  
  137. /******************************************************************************/
  138. /*                                                                            */
  139. /* normal: switches terminal (hpterm) into normal mode, i.e. turn off         */
  140. /*         reverse and blink mode                                             */
  141. /*         turn off reverse and blink option: ESC&d@                          */
  142. /*                                                                            */
  143. /******************************************************************************/
  144.  
  145. #ifdef REVERSEVIDEO
  146. #define normal() printf("\033&d@")
  147. #else
  148. #define normal()
  149. #endif
  150.  
  151. /******************************************************************************/
  152. /*                                                                            */
  153. /* clearScr: erases screen from cursor to end                                 */
  154. /*                                                                            */
  155. /******************************************************************************/
  156.  
  157. #define clearScr() printf("\033J")
  158.  
  159. /******************************************************************************/
  160. /*                                                                            */
  161. /* nl: prints 'new line' character                                            */
  162. /*                                                                            */
  163. /******************************************************************************/
  164.  
  165. #define nl() putchar('\n')
  166.  
  167. /******************************************************************************/
  168. /*                                                                            */
  169. /* bl: prints 'blank' character                                               */
  170. /*                                                                            */
  171. /******************************************************************************/
  172.  
  173. #define bl() putchar(' ')
  174.  
  175. /******************************************************************************/
  176. /*                                                                            */
  177. /* End of include file hpterm.h                                               */
  178. /*                                                                            */
  179. /******************************************************************************/
  180.